package com.ssy.lingxi.system.controller;

import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.PageModel;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.system.dto.request.PromptingLanguageDeleteRequest;
import com.ssy.lingxi.system.dto.request.PromptingLanguageListRequest;
import com.ssy.lingxi.system.dto.request.ReturnCodeDeleteRequest;
import com.ssy.lingxi.system.entity.PromptingLanguage;
import com.ssy.lingxi.system.entity.ReturnCode;
import com.ssy.lingxi.system.service.PromptingLanguageService;
import com.ssy.lingxi.system.service.ReturnCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @menu 基础设置-返回码设置管理
 * @author wrc
 * @date 2020/7/20
 */
@Api(tags = "返回码设置管理")
@RestController
public class ReturnCodeController {


    @Resource
    ReturnCodeService returnCodeService;

    @Resource
    PromptingLanguageService promptingLanguageService;

    @ApiOperation(value = "返回码设置列表")
    @GetMapping("/return/code/list")
    public Wrapper<PageData<ReturnCode>> returnCodeList(PageModel request) {
        return returnCodeService.returnCodeList(request);
    }


    @ApiOperation(value = "删除返回码设置记录")
    @PostMapping("/return/code/delete")
    public Wrapper returnCodeDelete(@RequestBody ReturnCodeDeleteRequest request) {
        return returnCodeService.returnCodeDelete(request);
    }


    @ApiOperation(value = "修改返回码设置记录")
    @PostMapping("/return/code/update")
    public Wrapper returnCodeUpdate(@RequestBody ReturnCode request) {
        return returnCodeService.returnCodeUpdate(request);
    }


    @ApiOperation(value = "添加返回码设置记录")
    @PostMapping("/return/code/add")
    public Wrapper returnCodeAdd(@RequestBody ReturnCode request) {
        return returnCodeService.returnCodeAdd(request);
    }


    @ApiOperation(value = "根据返回码ID查询提示语列表")
    @GetMapping("/prompting/language/list")
    public Wrapper<PageData<PromptingLanguage>> promptingLanguageList(PromptingLanguageListRequest request) {
        return promptingLanguageService.promptingLanguageList(request);
    }


    @ApiOperation(value = "提示语删除")
    @PostMapping("/prompting/language/delete")
    public Wrapper promptingLanguageDelete(@RequestBody PromptingLanguageDeleteRequest request) {
        return promptingLanguageService.promptingLanguageDelete(request);
    }


    @ApiOperation(value = "提示语修改")
    @PostMapping("/prompting/language/update")
    public Wrapper promptingLanguageUpdate(@RequestBody PromptingLanguage request) {
        return promptingLanguageService.promptingLanguageUpdate(request);
    }


    @ApiOperation(value = "提示语添加")
    @PostMapping("/prompting/language/add")
    public Wrapper promptingLanguageAdd(@RequestBody PromptingLanguage request) {
        return promptingLanguageService.promptingLanguageAdd(request);
    }




}
